<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul li {
            text-align: center;
            position: relative;
            width: 50px;
            margin-bottom: 10px;
            list-style: none;
            color: skyblue;
        }


        /* 样式一: */
        /* ul li::after {
            position: absolute;
            bottom: 0;
            left: 0;
            content: " ";
            height: 3px;
            width: 0px;
            background-color: pink;
            transition: all .5s;
        }

        ul li:hover::after {
            width: 100%;
        } */

        ul li::after {
            position: absolute;
            bottom: 0;
            /* left: 0; */
            left: 50%;
            content: " ";
            height: 3px;
            width: 0px;
            /* width: 50px; */
            transform: translateX(-50%);
            /* transform: scaleX(0); */
            background-color: pink;
            transition: all .5s ease-in;
        }


        ul li:hover::after {
            width: 100%;
            /* transform: scaleX(1); */

        }
    </style>
</head>

<body>
    <ul>
        <li>我是1</li>
        <li>我是2</li>
        <li>我是3</li>
        <li>我是4</li>
        <li>我是5</li>
    </ul>
</body>

</html>